//
//  Person.swift
//  SwiftStory
//
//  Created by ZxjMacBookPro on 2020/4/11.
//  Copyright © 2020 ZxjMacBookPro. All rights reserved.
//

import UIKit

class Person: NSObject {
    var name : String?
    var age : Int = 0
    
    var block : (() -> ())?
    
//    init(name : String, age : Int) {
//        self.name = name
//        self.age = age
//    }
    
    lazy var button: UIButton = {
        ()-> UIButton in
        let btn = UIButton()
        return btn
    }()
    
    func sum(a : Int, b : Int) -> Int {
        return a + b
    }
    
    func sum(a : Int, b : Int, c : Int) -> Int {
        return a + b + c
    }
    
    func sum(a : Double, b : Double, c : Double) -> Double {
        return a + b + c
    }
    
    func requested(block :@escaping () -> ()) {
        self.block = block
        print("调用block")
        block()
    }
    
    static let instance = Person()
    
    class func shared () -> Person{
        return instance
    }
}
